package com.example.covid19.mapper;

import com.example.covid19.entity.Studentinfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * VIEW Mapper 接口
 * </p>
 *
 * @author BaiZhengChun
 * @since 2023-03-11
 */
public interface StudentinfoMapper extends BaseMapper<Studentinfo> {

    @Select("SELECT " +
            " student.studentid, " +
            " student.phone, " +
            " student.ccid, " +
            " student.`name`, " +
            " builder.build_name, " +
            " room.lid, " +
            " college.cname, " +
            " cravate.rname, " +
            " classes.clname, " +
            " majeur.majeurname, " +
            " student.facetoken, " +
            " room.rid" +
            " FROM " +
            " builder " +
            " INNER JOIN " +
            " room " +
            " ON  " +
            " builder.lid = room.lid " +
            " INNER JOIN " +
            " student " +
            " ON  " +
            " student.rid = room.rid " +
            " INNER JOIN " +
            " classes " +
            " ON  " +
            " student.ccid = classes.ccid " +
            " INNER JOIN " +
            " majeur " +
            " ON  " +
            " classes.mid = majeur.mid " +
            " INNER JOIN " +
            " college " +
            " INNER JOIN " +
            " cravate " +
            " ON  " +
            " college.cid = cravate.cid AND " +
            " majeur.xid = cravate.xid")
    List<Studentinfo> studentinfs();

}
